/*
 * Copyright (c) 2021, 2022, yzfh.cn All rights reserved.
 *
 */
package com.ly.controller;



import com.ly.POJO.Good;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * @author yzfh
 * @Date 2022/03/07 星期一 15:09:40
 */
@Controller
@RequestMapping("good")
public class GoodController {

    @RequestMapping(value = "save", method = RequestMethod.POST)
    @ResponseBody
    public Good save(@RequestBody Good good) {
        System.out.println(good.toString());
        return good;
    }

    @RequestMapping(value = "bc", method = RequestMethod.POST)
    public Map save(@RequestBody Map map){
        Set<Map.Entry<String, Object>> set=map.entrySet();;
        Iterator<Map.Entry<String, Object>> it=set.iterator();
        while(it.hasNext()){
            Map.Entry<String, Object> entry=it.next();
            System.out.println(entry.getKey()+"=="+entry.getValue());
        }
        return map;
    }

}
